#include <iostream>
using namespace std;
int main()
{
    int N;
    int a[1000];
    cin >> N;
    for(int i = 0; i<N; i++)
        cin >> a[i];
    int count[10] = {0};
    for(int i = 0; i<N; i++)
    {
        int temp = a[i];
        if(temp == 0)
           count[0] = count[0] + 1;
        else
        {
            while(temp > 0)
            {
                int temp2 = temp % 10;
                count[temp2] =count[temp2] + 1; 
                temp = temp / 10; 
            }
        }
    }
    int max =count[0];
    for(int i = 0; i<10; i++)
    {
        if(max < count[i])
            max = count[i];
    }
    cout<<max<<":";
    for(int i = 0; i<10; i++)
    {
        if(max == count[i])
            cout<<" "<<i;
    }
    

}